 #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>

int isPrime(int num) 
{
    if (num <= 1) 
    {
        return 0;
    }

    for (int i = 2; i * i <= num; i++) 
    {
        if (num % i == 0) 
        {
            return 0;
        }
    }

    return 1;
}

int main() {
    int n, k;

    printf("Input n: ");
    scanf("%d", &n);

    k = n + 1;
    while (!isPrime(k)) {
        k++;
    }

    printf("%d\n", k);

    return 0;
}